<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]>      <html class="no-js"> <!--<![endif]-->
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <style>
      *{
        padding: 0;
        margin: 0;
      }
      .aaa{
        width: 500px;
        height: 500px;
        outline: 1px solid red;
        overflow: auto;
        position: relative;
        .bbb{
          height: 1000px;
          background: linear-gradient(#ccc, #fff);
        }
      }
    </style>
  </head>
  <body>
    11111
    <div class="aaa" onscroll="aaa(event)">
      <p>111</p>
      <div class="bbb"></div>
    </div>
  </body>
  </html>
  <script>
    let domB = document.querySelector('.bbb')
    function aaa(e) {
      console.log( e.target.scrollTop, domB.offsetTop );
    }
  </script>